<template>
	<view class="container">
		<form @submit="save">
			<view><text>标题：</text><input name="ntitle"></view>
			<view><text>日期：</text><input name="ndate"></view>
			<view><text>简介：</text><input name="ndesc"></view>
			<view><text>内容：</text><textarea name="ncontent"></textarea></view>
			<view><button type="warn" form-type="submit">保存新闻</button></view>
		</form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			save(e){
				console.log(e.detail.value)
				uni.request({
					url:'http://localhost:8081/nhcarssm1/api/news/save',
					data:e.detail.value,
					method:'POST',
					success: (res) => {
						console.log(res)
					}
				})
			}
		}
	}
</script>

<style>
.container{
	margin: 15rpx;
	padding: 20rpx;
	font-size: 32rpx;
}
.container input{
	margin-top: 10rpx;
	background-color: #eaeaea;
	line-height: 64rpx;
	height: 64rpx;
	border-radius: 8rpx;
	padding: 10rpx;
}
.container textarea{
	margin-top: 10rpx;
	background-color: #eaeaea;
	width:100%;
	border-radius: 8rpx;
	padding:10rpx;
	box-sizing: border-box;
}
button{
	margin-top: 20rpx;
}
</style>
